/**
 *	The NeuroCoSA Toolkit
 *	Copyright (C) 2003-6 Stuart Meikle.
 *
 *	This is free software; you can redistribute it and/or
 *	modify it under the terms of the GNU Lesser General Public
 *	License as published by the Free Software Foundation; either
 *	version 2.1 of the License, or (at your option) any later version.
 *
 *	This library is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *	Lesser General Public License for more details.
 *
 * @author	Stuart Meikle
 * @version	2006-halloween(mk2)
 * @license	LGPL
 */
package org.stumeikle.NeuroCoSA;
import java.io.*;
import java.util.*;
import org.stumeikle.NeuroCoSA.PubSub.InfoService;
import org.stumeikle.NeuroCoSA.PubSub.Publication;
import org.stumeikle.NeuroCoSA.PubSub.Subscriber;
import org.stumeikle.NeuroCoSA.NIS.*;
import org.stumeikle.NeuroCoSA.NeuroCoSAInfoService;

/** the information store at the layer level.
 *  this store will differ slightly from others in that the information provided
 *  depends on who asks for it. the class will ensure that neurons get the
 *  correct info , taking into account the update sequence order of the brain
 *  (Simplifies the synchronisation)
 */
public	class	LayerInfoService extends NeuroCoSAInfoService
{
    //static entries to the information service
    InfoString		iName;
    InfoLong		iBrainTime;
    
    // what else is static ? 
    // need to add: total surprise, total fear etc
    // relative firing strength for this lobe in comparison to other lobes
    // how drive strengths should change in the hierarchy
    // etc

    public LayerInfoService(CortexInfoService cis)
    {
	//initialise the static members and add to the info store
	iName = new InfoString("LayerName","custer"); //name of the value plus default value
	Info	n = new Info("CortexInfoService");
	n.setValue( cis );
	iBrainTime = cis.findInfoLong("BrainTime");

	addPublication(iName);
	addPublication(n);
	addPublication(iBrainTime);

	//!!!!!!!!!!
	// add in things like total surprise, total boredom, total confusion
	// total confidence etc
    }

    //subscribe to a couple of things, just to keep everything in sync
    
    //helpful methods
    public long	getBrainTime()
    { return iBrainTime.getLongValue(); }
}

